;;; -*- mode: lisp -*-

;; CL-EN
;;  Copyright 2008 Ben Hyde <bhyde@pobox.com>

(in-package "ECHONEST")

(defun enqueue-for-analysis (mp3-file)
  (let* ((pathname (pathname mp3-file))
         (filename
          (namestring (make-pathname :name (pathname-name pathname)
                                     :type (pathname-type pathname)))))
    (do-request 
        "upload" :post
        `(("Filedata" ,pathname :filename ,filename)
          ("Filename" . ,filename)))))

(defun poll-for-analysis (id)
  (do-request "xml" :get `(("id" . ,id))))
